<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D导航栏</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        ul {
            margin: 100px;
        }

        ul li {
            float: left;
            margin: 0 5px;
            width: 120px;
            height: 35px;
            list-style: none;
            perspective: 500px;
        }

        .box {
            position: relative;
            width: 100%;
            height: 100%;
            transform-style: preserve-3d;
            transition: all .4s;
        }

        .box:hover {
            transform: rotateX(90deg);
        }

        .front,
        .bottom {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            font-size: 30px;
            color: #fff;
            text-align: center;
            line-height: 35px;
        }

        .front {
            background-color: #1f4d6d;
            transform: translateZ(17.5px);
        }

        .bottom {
            background-color: #ffad33;
            /*有移动有旋转-要先移动*/
            transform: translateY(17.5px) rotateX(-90deg);
        }

    </style>
</head>
<body>
<ul>
    <li>
        <div class="box">
            <div class="front">Hello</div>
            <div class="bottom">Leve In</div>
        </div>
    </li>
    <li>
        <div class="box">
            <div class="front">Would</div>
            <div class="bottom">Coffee</div>
        </div>
    </li>
    <li>
        <div class="box">
            <div class="front">Teach</div>
            <div class="bottom">Chinses</div>
        </div>
    </li>
</ul>
</body>
</html>